package org.swust.sysmonitorapp.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.swust.sysmonitorapp.dto.SysUserDto;
import org.swust.sysmonitorapp.entity.CountDepartment;
import org.swust.sysmonitorapp.entity.QSysUser;
import org.swust.sysmonitorapp.entity.SysUser;
import com.baomidou.mybatisplus.extension.service.IService;

import java.io.Serializable;
import java.util.List;

/**
 * 用户表 服务类
 *
 * @since 2024-12-24
 */
public interface ISysUserService extends IService<SysUser> {
    IPage<SysUserDto> pageUser(Page<SysUserDto> page, QSysUser qSysUser);

    boolean editPassword(Integer id, String password);

    boolean resetPwd(Integer id);

    List<CountDepartment> countDepartment();
    
    /**
     * 根据用户名获取用户
     * 
     * @param username 用户名
     * @return 用户对象
     */
    SysUser getUserByUsername(String username);

    @Override
    boolean save(SysUser entity);

    @Override
    boolean updateById(SysUser entity);

    @Override
    boolean removeById(Serializable id);
}
